﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<JLL.China.Model.Listings>" %>
<div class="wrapper">
    <div class="left">
    <table border="0" cellpadding="0" cellspacing="0" class="tbl-form" >
     <caption>Listing Information</caption>
     <tr>
         <th></th>
            
     <td ><% if (this.Model != null)
                {
                    string checkedNewLaunch = "";
                    string checkedAction = "";
                    if (this.Model.NewLaunch!=null)
                    {
                        if (this.Model.NewLaunch.Value.ToString().Equals("True"))
                        {
                            checkedNewLaunch = "checked";
                        }
                    }
                    if (this.Model.Auction!=null)
                    {
                        if (this.Model.Auction.Value.ToString().Equals("True"))
                        {
                            checkedAction = "checked";
                        }
                    }
                   
                %>
            	 <span class="checkbox"><input type="checkbox" value="1" <%=checkedNewLaunch%>  name="NewLaunch" /> New Launch </span>
            <span class="checkbox"><input type="checkbox" <%=checkedAction%> value="1" name="Auction"/> Auction </span>
            <%}
                else
                { %>
                 <span class="checkbox"><input type="checkbox" value="1"  name="NewLaunch" /> New Launch </span>
            <span class="checkbox"><input type="checkbox"  value="1" name="Auction"/> Auction </span>
            <%} %></td>
     </tr>
    <tr>
        <th>
            <span class="mandate">*</span> <b>Project Name:</b>
        </th>
        <td>
          <% Html.RenderPartial("ProjectName",(this.Model==  null)? "":this.Model.ProjectNameFID.ToString()); %>
        
        </td>
        <td>
            </a>
            
        </td>
    </tr>
    <tr>
    <tr>
        <th><span class="mandate">*</span>Property For:</th>
        <td>
        
                            <% if (this.Model != null)
                               { %>
                            <input type="radio" name="PropertyFor" class="PropertyFor _sale" value="Sale" <%=(this.Model.PropertyFor != null) ? (this.Model.PropertyFor.ToString().Equals("Sale")) ? "checked" : "" : "" %>/>Sale
                            <input type="radio" name="PropertyFor" class="PropertyFor _rent" value="Rent" <%=(this.Model.PropertyFor != null) ? (this.Model.PropertyFor.ToString().Equals("Rent")) ? "checked" : "" : "" %> " style="
    margin-left: 18px;"/>
                           Rent
                            <%}
                               else
                               { %>
                            <span><input type="radio" class="PropertyFor _sale"  name="PropertyFor" value="Sale" checked /> Sale </span>
                       <span><input type="radio" class="PropertyFor _rent"  name="PropertyFor" value="Rent" style="
    margin-left: 18px;"/> Rent </span>
                       
                            <%} %>
        </td>
            
    </tr>
    <tr>
        <th ><span class="mandate">*</span> Property Classification:</th>
            <td>
            		 
                     <select class="validate[required] chzn-nosearch chz" name="PropertyClsssm" id="PropertyClsssm">
                                         <% if (this.Model != null)
                         { %>
                        <option value="Strata"  <%=(this.Model.PropertyClsssm != null) ? (this.Model.PropertyClsssm.ToString().Equals("Strata")) ? "selected='selected'" : "" : "" %> >Strata</option>
                         <option value="Landed"  <%=(this.Model.PropertyClsssm != null) ? (this.Model.PropertyClsssm.ToString().Equals("Landed")) ? "selected='selected'" : "" : "" %>>Landed</option>
                     <%}
                      else
                      { %>
                           <option value="Strata" >Strata</option>
                         <option value="Landed"  >Landed</option>
                     <%} %>
                     </select>
               
            </td>
            
    </tr>
     <tr>
            <th ><span class="mandate">*</span> Property Type:</th>
            <td>
            	<% Html.RenderPartial("PropertyType", (this.Model == null) ? "" : this.Model.PropertyTypeFID.ToString()); %>
               
            </td>
            
            </tr>
            <!--Begin City-->
   <% 
       string ControllerName = Html.ViewContext.Controller.ValueProvider.GetValue("controller").RawValue.ToString();
       string[] strCityLoSub = new string []{"","",""};
       string[] strCountryCity = new string[] { "", ""};
       if (this.Model != null)
       {
           if (ControllerName == "PropertyInternational" || ControllerName == "ProjectInternational")
           {
               strCountryCity = new string[] { this.Model.CountryFID.ToString(), this.Model.City };
               // 

           }
           else
           {
               if (this.Model.SubAreaFID != null)
               {
                   strCityLoSub = new string[] { this.Model.CityFID.ToString(), this.Model.LocaltionFID.ToString(), this.Model.SubAreaFID.ToString() };
               }
               else
               {
                   strCityLoSub = new string[] { this.Model.CityFID.ToString(), this.Model.LocaltionFID.ToString(), "" };
               }
           }

       }
       if (ControllerName == "PropertyInternational" || ControllerName == "ProjectInternational")
       {
           Html.RenderPartial("CountryCity", strCountryCity);
       }
       else
       {
           Html.RenderPartial("CityLocationSubarea", strCityLoSub);
           %>
         
           <%
       }
   %>
     <!--End City-->
       <tr>
        <th>
            <span class="mandate">*</span> <b>Street Name</b>
        </th>
        <td>
          <% Html.RenderPartial("StreetName", (this.Model== null) ? "" : this.Model.StreetNameFID.ToString()); %>
             </td>
        
    </tr>
     <tr>
     <th>
            <span class="mandate">*</span> <b>House Number</b>
        </th>
        <td>
         <input type="text" name="HouseNumber" id="HouseNumber" class="inp-form validate[required] " value="<%=(this.Model == null) ? "" : (this.Model.HouseNumber!=null)?this.Model.HouseNumber.ToString():"" %>" />
         </td>
     
     </tr>
            
   
</table>
     
    </div>
    <div class="right">
    <table border="0" cellpadding="0" cellspacing="0" class="tbl-form" >
        <caption>Property Details</caption>
            <tr>
                <th ><span class="mandate">*</span>Tenure:</th>
                 <td><input type="text" name="Tenure" id="tenure" class="inp-form validate[required] " value="<%=(this.Model == null) ? "" : this.Model.Tenure.ToString() %>" />
                <th  ><span class="mandate">*</span>Price:</th>
                
                <td><input type="text" name="Price" id="price" class="validate[required,custom[number]] inp-form "  value="<%=(this.Model == null) ? "" : this.Model.AskingPriceLocal.ToString() %>" />
                	
                </td>
            </tr>
            <tr>
            </tr>
            <tr>
                <th  style="padding-left:8px;"><span class="mandate"></span>Price in RMB/sqm:</th>
                <td><input type="text" name="PriceRMB" id="PriceRMB" class="validate[custom[number]] inp-form "  value="<%=(this.Model == null) ? "" : this.Model.PriceInRMBPerSQMLocal.ToString() %>" />
                	
                </td>
               <th ><span class="mandate">*</span>Price Unit:</th>
                <td>
                	
                        <select  class="chzn-nosearch chz" id="priceunit" name="Priceunit">
                    
							<option value="RMB">RMB</option>
							
						          
                        </select>
                    
                </td>
                
            </tr>
             
            <tr>
            <th ><span class="mandate">*</span> Bedroom:</th>
            <td>
            	<div class="select_holder">		
                    <% Html.RenderPartial("Bedroom",  (this.Model == null) ? "" : this.Model.Bedroom.ToString() ); %>
                </div>
            </td>
            <th ><span class="mandate">*</span> Bathroom:</th>
            <td>
            	<div class="select_holder">		
                    <% Html.RenderPartial("Bathroom", (this.Model == null) ? "" : this.Model.Bathroom.ToString()); %>
                </div>
            </td>
            </tr>
            <tr>
                <th ><span class="mandate area_required">*</span> Floor Area </th>
                <td>
                <input type="text" name="FloorArea" id="FloorArea" class="validate[required,custom[number]] inp-form " value="<%=(this.Model == null) ? "" : this.Model.FloorArea_SM.ToString() %>"/>
                </td>
               <th ><span class="mandate area_required">*</span> Floor Area Unit</th>
                <td>
                <select class="validate[required] chzn-nosearch chz" name="FloorAreaUnit">
                                
                  <% if (this.Model != null)
                         { %>
                        <option value="sqm"  <%=(this.Model.FloorAreaUnit != null) ? (this.Model.FloorAreaUnit.ToString().Equals("sqm")) ? "selected='selected'" : "" : "" %> >sqm</option>
                         <option value="sqft"  <%=(this.Model.FloorAreaUnit != null) ? (this.Model.FloorAreaUnit.ToString().Equals("sqft")) ? "selected='selected'" : "" : "" %>>sqft</option>
                     <%}
                      else
                      { %>
                         <option value="sqm">sqm</option>
                         <option value="sqft">sqft</option>
                     <%} %>
                    
                </select>
                
                </td>
            </tr>
            
            <tr>
                <th ><span class="mandate area_required"></span> Land Area </th>
                <td>
                <% if (this.Model != null)
                   { %>
                    <%
                        if (this.Model.LandAreaUnit!=null)
                        {
                            if (this.Model.LandAreaUnit.Equals("sqm"))
                           { %>
                            <input type="text" name="LandArea"  class="validate[custom[number]] inp-form " value="<%=(this.Model == null) ? "" : this.Model.LandArea_SM.ToString() %>"/>
                        <%}
                            }
                       else
                       {%>
                          <input type="text" name="LandArea"  class="validate[custom[number]] inp-form " value="<%=(this.Model == null) ? "" : this.Model.LandArea_SF.ToString() %>"/>
                 
                	<%}
                   }
                   else
                   {%>
                    <input type="text" name="LandArea"  class="validate[custom[number]] inp-form " value=""/>
                 
                   <%} %>
              </td>
               <th ><span class="mandate area_required"></span> Land Area Unit:</th>
                <td>
                <select class="chzn-nosearch chz" name="LandAreaUnit">
                
                  <% if (this.Model != null)
                         { %>
                        <option value="sqm"  <%=(this.Model.LandAreaUnit != null) ? (this.Model.LandAreaUnit.ToString().Equals("sqm")) ? "selected='selected'" : "" : "" %> >sqm</option>
                         <option value="sqft"  <%=(this.Model.LandAreaUnit != null) ? (this.Model.LandAreaUnit.ToString().Equals("sqft")) ? "selected='selected'" : "" : "" %>>sqft</option>
                     <%}
                      else
                      { %>
                         <option value="sqm">sqm</option>
                         <option value="sqft">sqft</option>
                     <%} %>
                    
                </select>
                
                </td>
              </tr>
             
             <tr>
                <th ><span class="mandate area_required"></span> Total Floor:</th>
                <td>
                <input type="text" name="TotalFloor" id="TotalFloor" class="validate[custom[number]] inp-form " value="<%=(this.Model == null) ? "" : this.Model.TotalFloor.ToString() %>"/>
                </td>
              
            </tr>
            <tr>
             <th ><span class="mandate area_required"> </span> Floor Level:</th>
                <td>
                <select class="chzn-nosearch chz" name="FloorLevel">
                    <option value=""> </option>
                    <% if (this.Model != null)
                         { %>
                        <option value="Low"  <%=(this.Model.FloorLevel != null) ? (this.Model.FloorLevel.ToString().Equals("Low")) ? "selected='selected'" : "" : "" %> >Low</option>
                         <option value="Mid"  <%=(this.Model.FloorLevel != null) ? (this.Model.FloorLevel.ToString().Equals("Mid")) ? "selected='selected'" : "" : "" %>>Mid</option>
                     <option value="High"  <%=(this.Model.FloorLevel != null) ? (this.Model.FloorLevel.ToString().Equals("High")) ? "selected='selected'" : "" : "" %>>High</option>
                     <%}
                      else
                      { %>
                         <option value="Low">Low</option>
                     <option value="Mid">Mid</option>
                     <option value="High">High</option>
                     <%} %>
                  
                </select>
                </td>
            </tr>
             <tr>
               <th ><span class="mandate area_required"> </span> Efficiency Rate</th>
                <td>
                  <input type="text" name="EfficiencyRate"  class="validate[custom[number]] inp-form " value="<%=(this.Model == null) ? "" : (this.Model.EfficiencyRate!=null)?this.Model.EfficiencyRate.Value.ToString():""%>"/>
                
             
               </td>
              
            </tr>
            <tr>
                <!--AGENT CHANGE-->
             <th><span class="mandate">*</span>Agent in-charge:</th>
            <td >
            	 <% Html.RenderPartial("Agents",(this.Model == null) ? "" : this.Model.MemberFID.ToString()); %>
            	 	
            </td>
            </tr>
            
            
           
     </table>
    </div>

    <div style="clear:both">
    <table border="0" cellpadding="0" cellspacing="0" class="tbl-form" style="width: 98%;">
    <tr>
    <td><br /> <br /></td>
    </tr>
    <tr>
                           
                <th  style="min-width:81px" valign="top"><span class="mandate area_required">*</span> Description:</th>
                <td>
             
                <p><b>English</b></p>
                <input id="description_validate" class="validate[required]" style="visibility:hidden;height:0;"/>
               <textarea class="ckeditors" cols="78" id="description" name="Description" rows="10"><%=(this.Model == null) ? "" : this.Model.Description.ToString()%></textarea> <br />
                 <p><b>Local</b></p>            
                 <input id="descriptionlocal_validate" class="validate[required]" style="visibility:hidden;height:0;"/>
               <textarea class="ckeditors" cols="88" id="descriptionlocal" name="DescriptionLocal" rows="10"><%=(this.Model == null) ? "" : this.Model.DescriptionLocal.ToString()%></textarea> 
                
                           
             
                </td>
                
            </tr>
                     </tr>
    <tr class="button_ctr">
        
        <td colspan=4 style="text-align: right;">
        <br />
         <% if(this.Model!=null){ %>
                       <input type="button" style="margin-right: 3px;" value="Next" class="buttons" onclick="javascript:window.location.href='<%=Url.Content("~/")%><%=ViewData["now_controller"]%>Step2/<%= ViewData["ListingID"].ToString()%>'" />
                       <%} %>
                    <input type="submit" style="margin-right: 5px" value="Save and proceed to Step 2" class="buttons"  onclick="checkForm();" />
          
        </td>
       
    </tr>
    </table>
    </div>
</div>
